
<html>
<head>
<meta charset="UTF-8">
<title>字典条目信息新增</title>
<link href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../ffres/dict/all.js"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout">
	    <form id="ff" method="post">
	    	<div class="esaas-info-title">数据条目信息</div>
	    	<table class="esaas-info-add-table">
	    		<tr>
	    			<td width="15%" align="right">条目代码：</td>
	    			<td width="35%">
	    				<input class="easyui-textbox" type="text" name="itemCode" id="itemCode" data-options="required:true" style="width:70%;height:25px;"/>
	    				<a href="javascript:void(0)" class="easyui-linkbutton" onclick="choiceWord()">&nbsp;选&nbsp;择&nbsp;</a>
	    			</td>
	    			<td width="15%" align="right">条目名称：</td>
	    			<td width="35%">
	    				<input class="easyui-textbox" type="text" name="itemName" id="itemName" data-options="required:true" style="width:100%;height:25px;"></input>
	    			</td>			
	    		</tr>
	    		<tr>
	    			<td width="15%" align="right" valign="top">条目描述：</td>
	    			<td colspan="3"><textarea name="itemRemarks" id="itemRemarks" class="easyui-validatebox" style="overflow-x:hidden;height:60px;width:98%;"></textarea></td>
	    		</tr>
	    		<tr>
	    			<td width="15%" align="right">数据类型：</td>
	    			<td width="35%"><select class="easyui-combobox" id="itemDataType" name="itemDataType" style="width:100%;height:25px;" data-options="required:true,editable:false,valueField:'enname',textField:'cnname',data:PUB_DATA_TYPE"></select></td>
					<td width="15%"></td>
					<td width="35%"></td> 	    			
	    		</tr>  		
	    		<tr>
	    			<td width="15%" align="right">数据长度：</td>
	    			<td><input class="easyui-textbox" type="text" id="itemDataLength" name="itemDataLength" style="width:100%;height:25px;"></input></td>
	    			<td width="15%" align="right">数据精度：</td>
	    			<td><input class="easyui-numberbox" type="text" id="itemDataPrecision" name="itemDataPrecision" style="width:100%;height:25px;" value="0"></input></td>	    			
	    		</tr>
	    		<tr>
	    			<td width="15%" align="right">数据选项：</td>
	    			<td>
	    			<input class="easyui-textbox" id="dictCode" name="dictCode" readOnly style="width:70%;height:25px;"/>
	    			<a href="javascript:void(0)" class="easyui-linkbutton" onclick="choiceDictOption()">&nbsp;选&nbsp;择&nbsp;</a>
	    			</td>
	    			<td hidden="true">
						<input class="easyui-textbox" id="dictId" name="dictId" />
					</td>
	    			<td></td>
	    		</tr>
	    	</table>
	    </form>
	    <div style="text-align:center;padding:50px">
	    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">&nbsp;&nbsp;保&nbsp;&nbsp;存&nbsp;&nbsp;</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="closeForm()">&nbsp;&nbsp;关&nbsp;&nbsp;闭&nbsp;&nbsp;</a>
	    </div>

	<script>
		$(function() {

		});
		
		function choiceWord(){
			JLEUtil.createFullModalWin('', 'CompositWord.html');
		}
		
		function returnChoiceWord(code,name){
			$("#itemCode").textbox('setValue',code);
			$("#itemName").textbox('setValue',name);
			JLEUtil.closewin();
		}
		
		function choiceDictOption(){
			JLEUtil.createFullModalWin('', 'ChoiceDictOption.html?callBack=doFinishOptionChoice');			
		}
		
		function doFinishOptionChoice(dictId,dictCode){
			$("#dictCode").textbox('setValue',dictCode);
			$("#dictId").textbox('setValue',dictId);
			JLEUtil.closewin();
		}


		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			var jsonData = $("#ff").serializeJson();
			$.restfulPostJson('../../api/dict/item/info', jsonData, function(data) {
				window.parent.reloadList();
			});
		};
		
		function closeForm() {
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>
